package com.zhonghui.common.eshopEnum;

import java.util.stream.Stream;

public enum  SortEnum {
    DESC("desc", "降序"),
    ASC("asc", "升序");

    private String value;
    private String desc;

    public static SortEnum toType(String value) {
        return (SortEnum) Stream.of(values()).filter((p) -> {
            return p.value == value;
        }).findAny().orElse( (SortEnum) null );
    }

    public String getValue() {
        return this.value;
    }

    public String getDesc() {
        return this.desc;
    }

    private SortEnum(final String value, final String desc) {
        this.value = value;
        this.desc = desc;
    }
}

